package com.triones.yjj.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.mapper.BaseMapperPlus;
import com.triones.yjj.entity.MemberWithdrawDO;
import com.triones.yjj.entity.OrderTradeRecordDO;
import com.triones.yjj.entity.StaffDO;
import com.triones.yjj.entity.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 订单交易 mapper 接口
 *
 * @Author: triones
 */
public interface OrderTradeRecordMapper extends BaseMapperPlus<OrderTradeRecordMapper, OrderTradeRecordDO, OrderTradeRecordVO> {

    /**
     * 余额明细列表（分页）
     * @param build
     * @param wrapper
     * @return
     */
    Page<RemainderDetailListVO> remainderPageList(@Param("params") Page<Object> build,@Param(Constants.WRAPPER) QueryWrapper<StaffDO> wrapper);

    /**
     * 提现明细列表（分页）
     * @param build
     * @param wrapper
     * @return
     */
    Page<WithdrawalRecordVO> withdrawalPageList(@Param("params") Page<Object> build,@Param(Constants.WRAPPER) QueryWrapper<StaffDO> wrapper);

    /**
     * 待结算明细列表（分页）
     * @param build
     * @param wrapper
     * @return
     */
    Page<WaitSettlementRecordVO> waitSettlementDetailList(@Param("params") Page<Object> build,@Param(Constants.WRAPPER) QueryWrapper<OrderTradeRecordDO> wrapper);

    /**
     * 可提现金额
     * @param userId
     * @return
     */
    String waitWithdrawalTotal(@Param("userId") Long userId);

    /**
     * 待结算金额
     * @param userId
     * @return
     */
    String waitSettlementTotal(@Param("userId") Long userId);

    /**
     * 提现成功金额
     * @param userId
     * @return
     */
    String alreadyWithdrawalTotal(@Param("userId") Long userId);

    /**
     * 累计分销佣金
     * @param userId
     * @return
     */
    String inviteDeductionTotal(@Param("userId") Long userId);

    /**
     * 累计手续费
     * @param userId
     * @return
     */
    String commissionTotal(@Param("userId") Long userId);

    /**
     * 提现申请列表
     * @param build
     * @param wrapper
     * @return
     */
    Page<MemberWithdrawListVO> memberWithdrawPageList(@Param("params") Page<Object> build,@Param(Constants.WRAPPER) QueryWrapper<MemberWithdrawDO> wrapper);
}
